 <link rel="stylesheet" href="../Public/style/user.css" />
<script>
function sub_save(){
	
	$("#myform2").submit();
	}
</script>
 <!-- 共用头部1 -->
	 <div id="top">
		 <div class="head1 clear">
			 <div class="account sprite_icon" style="text-align:center; ">
                  <a href="index.php?g=Mobile&m=User&a=index" style=" color:#FFF; line-height:50px">
                 {if cookie('username')}
                  {php $user=M('User')->field('username')->where('id='.$jgsatuserid)->find()}
                  {php echo $user['username']} 
                 {else}登录
                 {/if}
                 </a>
			 </div>
			 {if $title}
			    <div class="title">{$title}</div> 
               {else}
                <div class="title">{$seo_title}</div> 
               {/if}</div>
	 </div>
 <include file="Mobile:nav"/>     	 
<form  id="myform2" method="post" action="{:U('Mobile/Register/save')}" >
	 <div class="U_padding sb_user find_poss">
		 <div class="text">	
		     <div class="sb_text clear">
				 <em class="icon3 icon_com"></em>
				 <input type="text" placeholder="手机号码" value="" id="mobile" name="mobile" class="reg-form-input rf-input-l"/>
			 </div>
			 
		 </div>

		 <div class="text clear">
			 <div class="sb_text2">
				 <em class="icon4 icon_com"></em>
				<input type="text" name="mobileYzm" class="text2" placeholder="请输入验证码" />
			 </div>

			 
              <input type="button"  id="btn_mss" class="send" value="获取验证码" />
			 
		 </div>

		 <div class="text">	
		     <div class="sb_text clear">
				 <em class="icon6 icon_com"></em>
				 <input type="password" name="password" validate="required:true" id="password" placeholder="请输入新密码">
			 </div>
		 </div>

		 <div class="text">	
		     <div class="sb_text clear">
				 <em class="icon6 icon_com"></em>
				 <input type="password" name="password1" validate="required:true,equalTo: '#password'" placeholder="确认新密码">
			 </div>
		 </div>

		 <a href="javascript:sub_save();" class="register">
			 修改密码
		 </a>
	 </div>
 </form>
 <script>
 $('#btn_mss').click(function(){
      var tel = $.trim($('#mobile').val());
       var partten = /^[1][34578][0-9]{9}$/;
	  // alert(222)
	  if(tel){
		  if(partten.test(tel)){
			  $.post('index.php?g=User&m=Sms&a=index', {'tel':tel},function(res){
				  // alert(res);
				  if(res!=0){ alert('发送失败错误代码'+res)}else{ time(document.getElementById("btn_mss"));}
			   });
			 }else{alert('手机号格式不正确')}
	  }else{alert('请输入手机号')}
    });



/*document.getElementById("btn_mss").onclick=function(){
    var mobile=document.getElementById("mobile").value;
    var partten = /^[1][34578][0-9]{9}$/;
    var fl=false;
    if(partten.test(mobile))
    {
        time(document.getElementById("btn_mss"));

    }

}*/

var wait=120;
  function time(o) {
    if (wait == 0) {
      o.removeAttribute("disabled");
      o.value="免费获取验证码";
      wait = 120;
    } else {
      o.setAttribute("disabled", true);
      o.value="重新发送(" + wait + ")";
      wait--;
      setTimeout(function() {
                time(o)
              },
              1000)
    }
  }
 
 
 </script>